//
// Created by unreal on 2024/8/19.
//

#ifndef HOUSEBUILDER_H
#define HOUSEBUILDER_H
#include "House.h"

/**
 * 构建的整体步骤是稳定的
 */
class HouseBuilder {
public:
    HouseBuilder(House* house);
    virtual ~HouseBuilder() = default;

    virtual void builderPart1() = 0;
    virtual void builderPart2() = 0;
    virtual void builderPart3() = 0;

    House* getHouse() const;

protected:
    House* house;
};

// 子类实现步骤的具体构造算法
class StoneHouseBuilder : public HouseBuilder {
public:
    StoneHouseBuilder(House* house);

    void builderPart1() override;
    void builderPart2() override;
    void builderPart3() override;
};

#endif //HOUSEBUILDER_H
